const mongoose = require('mongoose');
require('mongoose-long')(mongoose);
let schemaTypes = mongoose.Schema.Types;

//角色schema
let roleSchema = new mongoose.Schema({
    _id: {
        type: schemaTypes.ObjectId,
        require: true // 不可为空约束
    },
    //角色名
    name: {
        type: String,
        require: true
    },
    //创建时间
    crtime: {
        type: schemaTypes.Long,
        require: true
    },
    //更新时间
    chtime: {
        type: schemaTypes.Long,
        require: true
    },
}, {
    versionKey: false
});

//角色模型
let RoleModel = mongoose.model('RoleModel', roleSchema, 'acl_role');
module.exports = RoleModel;